#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
#include <stdio.h>



static int no_buf( lua_State *L) {
	setbuf(stdout, NULL);
	setbuf(stderr, NULL);
	return 0;
}


int luaopen_bufutil( lua_State *L) {
  static const luaL_reg Map[] = {
    {"nobuf",  no_buf},
    {NULL, NULL}
  };

  luaL_register(L, "bufutil", Map);
  return 1;
}
